package compositeExpression_Fact;

import visitor.Visitor;
import compositeExpression.Expr;
import compositeExpression.Expression;
import compositeExpression.Fact;
import exceptions.IllegalContextException;

public class FactExpr extends Fact {
	
	 private Expr expr;

	    public FactExpr(Expr expr) {

	        if (expr == null) {

	            throw new NullPointerException();
	        }

	        this.expr = expr;
	    }

	    public Expr getState() {

	        return expr;
	    }// getStato

	@Override
	public void toAssess(String p) throws IllegalContextException {
        expr.toAssess(p);

	}
	
	

	@Override
    public void accept(Visitor v) {
        v.visit(this);
    }
	
	
	@Override
	public void add(Expression termb) {
		throw new IllegalStateException("operazione invalida");
	}

}
